package com.fuluwa.domain.usercenter.model.competence;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;

//detail define for value,CET-4=2,
@Entity
public class MaterialLevelDefine extends AbstractDefine {
	@ManyToOne
	private MaterialLevelType levelType;

	private MaterialLevelDefine() {
	}

	public MaterialLevelDefine(String name, float value, MaterialLevelType levelType) {
		super(name, value);
		this.levelType = levelType;
	}

	public float compute() {
		return value * levelType.getMaterialSubDefine().compute();
	}

	public MaterialLevelType getLevelType() {
		return levelType;
	}

}